package T6_2;

public class Dog extends PetImp {


    public Dog(String name, int age) {
        super(name,age);
    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof Dog){
            Dog dog = (Dog) obj;
            boolean equals = name.equals(dog.getName()) && age == dog.getAge();
            return equals;
        }
        return false;
    }

    @Override
    public String toString() {
        return getName()+"  "+getAge();
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public int getAge() {
        return age;
    }
}
